package routers

import (
	"ce/handlers"
	"github.com/gin-contrib/cors"
	"github.com/gin-gonic/gin"
)

func Init() *gin.Engine {
	r := gin.Default()
	r.Use(cors.Default())
	r.POST("/user/login", handlers.UserLogin)
	r.POST("/roleAddNode", handlers.RoleAddNode)
	r.GET("/user/role", handlers.UserRole)
	r.GET("/role/node", handlers.RoleNode)
	r.POST("/car/add", handlers.Car)
	r.POST("/order/add", handlers.Order)
	r.GET("/order/list", handlers.OrderList)
	r.GET("/order/detail", handlers.OrderDetail)
	return r
}
